package GUItest;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public class main_Screen extends JFrame {

	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					main_Screen frame = new main_Screen();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public main_Screen() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JButton statementsButton = new JButton("Statements");
		statementsButton.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				Statements_Screen statements = new Statements_Screen();
				statements.setVisible(true);
			}
		});
		statementsButton.setBounds(52, 48, 117, 106);
		contentPane.add(statementsButton);
		
		JButton btnTransferFunds = new JButton("Transfer Funds");
		btnTransferFunds.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				TransferScreen transfer = new TransferScreen();
				transfer.setVisible(true);
			}
		});
		btnTransferFunds.setBounds(168, 48, 117, 106);
		contentPane.add(btnTransferFunds);
		
		JButton btnPayBills = new JButton("Pay Bills");
		btnPayBills.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				PayBillsScreen payBill = new PayBillsScreen();
				payBill.setVisible(true);
			}
		});
		btnPayBills.setBounds(282, 48, 117, 106);
		contentPane.add(btnPayBills);
		
		JButton btnLoans = new JButton("Loans");
		btnLoans.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				LoanScreen loans = new LoanScreen();
				loans.setVisible(true);
			}
		});
		btnLoans.setBounds(52, 155, 117, 106);
		contentPane.add(btnLoans);
		
		JButton btnPrintChecks = new JButton("Print Checks");
		btnPrintChecks.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				ChecksScreen printChecks = new ChecksScreen();
				printChecks.setVisible(true);
			}
		});
		btnPrintChecks.setBounds(168, 155, 117, 106);
		contentPane.add(btnPrintChecks);
		
		JButton btnSettings = new JButton("Settings");
		btnSettings.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				//SettingsScreen settings = new SettingsScreen();
				//settings.setVisible(true);
			}
		});
		btnSettings.setBounds(282, 155, 117, 106);
		contentPane.add(btnSettings);
		
		JButton btnLogOut = new JButton("Log Out");
		btnLogOut.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				WindowBuilderTest login = new WindowBuilderTest();
				login.setVisible(true);
				setVisible(false);
				WindowBuilderTest.connection.closeConnection();
			}
		});
		btnLogOut.setBounds(327, 7, 117, 29);
		contentPane.add(btnLogOut);
	}
}
